package com.cmccgz.udacs_landlord_webapp.main.peoplemanager.presenter;

import com.cmccgz.udacs_landlord_webapp.R;
import com.cmccgz.udacs_landlord_webapp.bean.PeopleFunc;
import com.cmccgz.udacs_landlord_webapp.main.peoplemanager.AddCardActivity;
import com.cmccgz.udacs_landlord_webapp.main.peoplemanager.DelayCardActivity;
import com.cmccgz.udacs_landlord_webapp.main.peoplemanager.ExchangeCardActivity;
import com.cmccgz.udacs_landlord_webapp.main.peoplemanager.PeopleListActivity;
import com.cmccgz.udacs_landlord_webapp.main.peoplemanager.RecoverCardActivity;
import com.cmccgz.udacs_landlord_webapp.main.peoplemanager.StopCardActivity;
import com.cmccgz.udacs_landlord_webapp.main.peoplemanager.XiaoCardActivity;
import com.cmccgz.udacs_landlord_webapp.main.peoplemanager.contract.PeopleContract;

import java.util.ArrayList;

/**
 * @author Denis
 * @ClassName: PeoplePresenter
 * @Description: 租客管理功能列表页
 * @date 2017/6/7 14:37
 */

public class PeoplePresenter implements PeopleContract.Presenter {
    private PeopleContract.View view;
    private String[] titles = {"新增卡片", "换卡", "销卡", "延期", "暂停", "恢复"};
    private String[] details = {"为租客新增卡片", "为租客更换房卡", "为租客注销房卡", "延长租客房卡有效期", "暂停租客房卡权限", "恢复租客房卡权限"};
    private int[] icons = {R.mipmap.icon_card_58, R.mipmap.icon_change, R.mipmap.icon_xiao, R.mipmap.icon_delay, R.mipmap.icon_stop, R.mipmap.icon_return2};
    private Class[] classList = {PeopleListActivity.class, PeopleListActivity.class, PeopleListActivity.class, PeopleListActivity.class, PeopleListActivity.class, PeopleListActivity.class};
    private Class[] funcClassList = {AddCardActivity.class, ExchangeCardActivity.class, XiaoCardActivity.class, DelayCardActivity.class, StopCardActivity.class, RecoverCardActivity.class};

    public PeoplePresenter(PeopleContract.View view) {
        this.view = view;
        view.setPresenter(this);
    }

    @Override
    public void initData() {

        ArrayList<PeopleFunc> datas = new ArrayList<>();
        for (int i = 0; i < titles.length; i++) {
            datas.add(new PeopleFunc(titles[i], details[i], icons[i], classList[i], funcClassList[i]));
        }
        view.getData(datas);
    }

    @Override
    public void start() {

    }
}
